/**
 * This file is part of the CAKIS project.
 * 
 * Copyright (c) 2009-2010 - Florian Arndt, Christian Kerl
 * 
 * @license GNU Lesser General Public License v3 <http://www.opensource.org/licenses/lgpl-3.0.html>
 * @since   11.04.2010
 * @version SVN: $Id: StockUnitNotFoundException.java 76 2010-04-11 17:49:32Z christian-kerl@web.de $
 */
package org.cakis.server.service;

import javax.ejb.ApplicationException;

/**
 * StockUnitNotFoundException
 *
 * @author Christian Kerl
 */
@ApplicationException
public class StockUnitNotFoundException extends Exception {
    public static final String NullUnit = "<NoUnitNameOrSymbol>";
    private static final long serialVersionUID = 1L;

    private final String unit;

    public String getUnit() {
        return unit;
    }

    public StockUnitNotFoundException(String unit) {
        super();
        if(unit != null && !unit.isEmpty()) {
            this.unit = unit;
        } else {
            this.unit = NullUnit;
        }
    }
}
